package com.example.mushroom.service.impl;

import com.example.mushroom.entity.Batch;
import com.example.mushroom.mapper.BatchMapper;
import com.example.mushroom.service.BatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class BatchServiceImpl implements BatchService {

    @Autowired
    private BatchMapper batchMapper;

    @Override
    public int insertBatch(Batch batch) {
        return batchMapper.insertBatch(batch);
    }

    @Override
    public Batch selectBatchById(Integer id) {
        return batchMapper.selectBatchById(id);
    }

    @Override
    public List<Batch> selectAllBatches() {
        return batchMapper.selectAllBatches();
    }

    @Override
    public int updateBatch(Batch batch) {
        return batchMapper.updateBatch(batch);
    }

    @Override
    public int deleteBatchById(Integer id) {
        return batchMapper.deleteBatchById(id);
    }

    @Override
    public List<Batch> selectBatchesByPage(int offset, int limit) {
        return batchMapper.selectBatchesByPage(offset, limit);
    }
}